import axios from 'axios';

const instance = axios.create({
  baseURL: import.meta.env.VITE_BASE_URL, //使用环境变量
  timeout: 8000,
  headers: {
    'Content-Type': 'application/json',
  }
});

instance.interceptors.response.use((res) => {
  return res //请求成功
}, (err) => {   //请求失败
  
  ElNotification({
    title: 'Error',
    message: '请求错误!\n错误码' + err,
    type: 'error',
  })
})

export default instance;